﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataService.Core.Container
{
    /// <summary>范围服务工厂</summary>
    public interface IServiceScopeFactory
    {
        /// <summary>创建范围服务</summary>
        /// <returns></returns>
        IServiceScope CreateScope();
    }

    class MyServiceScopeFactory : IServiceScopeFactory
    {
        public IServiceProvider? ServiceProvider { get; set; }

        public IServiceScope CreateScope() => new MyServiceScope { MyServiceProvider = ServiceProvider };
    }
}
